<?
	require("required/dbconnect.php");
	require("required/function.php");
	require("required/email.php");
	
	$id=$_SESSION['loginid'];
	
	
	//------------------------ get data -----------------------------------
	$getid=mysql_query("select * from os_member where id=$id");
	$subject="Member activation(resent)";
	
	$id=mysql_result($getid,0,'id');
	$code=generatePassword();
	$enid=(($id+$code)-983421)*(-25);
	$activatecode=mysql_result($getid,0,'activate_code');
	
	$to=mysql_result($getid,0,'email'); //receiver email here
	$name=mysql_result($getid,0,'name');
	
	$get_info=mysql_query("select * from os_contactinfo where id=1");
	$i=mysql_fetch_array($get_info,MYSQL_ASSOC);
	$websitename_eng=$i['website_name'];
	$logo_url=$i['logo_url'];
	$os_url=$i['website'];
	//-----------------------------------Body begin----------------------------
	$body="
	<html>
	<head>
	
 	</head>
<body>
<table width='80%' align='center'>

<td width='100%'>
<table width='80%' style='border:1px #999999 solid' align='center'>
<tr>
			<td>
				<center><img src='$logo_url'></center>
				Dear $name,<br><br> 
				Thank you for joining as an online member of D Looking Glass. Please click on the link below in order to activate your account.<br><br>
				<a href='$os_url/memberactivate.php?activatecode=$activatecode&id=$enid&dbase=$code'>Activate Account</a>	
			</td>
</tr>
</table>
</td>
</table>
</body>
</html>	"; 
//-------------------------------- end of body ---------------------------------

	$headers  = "MIME-Version: 1.0\r\n";
	$headers .= "Content-type: text/html; charset=gb2312\r\n";
	$headers .= "From:".$i['email'];		
	
	email_send($body,$to,"",$subject,"",$i['email']);
	//mail($to,$subject,$body,$headers);	
	

	
header("Location:os_resendactivation2.php?email=$to");
?>
	